const state = () => ({
       username: "未登录用户",
       girls: ["小红", "小花"],
       lang:'zh'
     })
     const getters = {
       gilsNum: state => {
         return state.girls.length;
       }
     }
     const mutations = {
       M_LOGIN(state, username) {
         state.username = username;
       },
       M_LOGOUT(state) {
         state.username = "未登录用户";
       },
       M_ADDGIRL(state, girl) {
         state.girls.push(girl);
       },
       setLang(state,lang){
         state.lang=lang
       }
     };
     const actions = {
       login({ state, commit }, name) {
         commit("M_LOGIN", name);
       },
       logout({ state, commit }) {
         commit("M_LOGOUT");
       },
       addGirl({ state, commit }, girl) {
         commit("M_ADDGIRL", girl);
       }
     };
     export default {
       namespaced: true,
       state,
       getters,
       mutations,
       actions
     };